<?php framework::view('index/header')?>
<script type="text/javascript">
function reg(){
	var url = '<?php echo HIGHPHP_WWW_HOST?>user/reg';
	var email = $.trim($("#email").val());
	var phone = $.trim($("#phone").val());
	var pwd = $.trim($("#pwd").val());
	var username = $.trim($("#username").val());
	var name = $.trim($("#name").val());
	var code = $.trim($("#code").val());
	var checkcode = $.trim($("#checkcode").val());
    $.post(url,{'email':email,'phone':phone,'pwd':pwd,'username':username, 'name':name,'code':code,'checkcode':checkcode},function(rs){
        if(rs=='成功'){
        	$("#msginfo").html(rs);
            window.location.href='<?php echo $tourl;?>';
        }else{
            $("#msginfo").html(rs);
        }
    })
}
</script>

<div class="loginact" style="width:100%;min-height: 400px;border-top: solid 2px #ff9900;">
<div style="" class="lrtab">

<a href="<?php echo HIGHPHP_WWW_HOST?>user/login" style="border-left: solid 1px #DFDFDF" >用户登录</a>
<a href="<?php echo HIGHPHP_WWW_HOST?>user/reg" class="lrtabon">用户注册</a>
</div>
<div class="clear"></div>
<form onsubmit="reg();return false;">
	<table style="width: 100%">
	    <tr >
	    <td align="right" width="30%">&nbsp;</td><td width="230"  id="msginfo">
	    <td>&nbsp;</td></tr>
		<tr id="emr">
			<td align="right" width="30%">*邮箱：</td>
			<td width="230"><input type="text" value="" name="email" id="email" class="logintext" tabindex="1"></td>
			<td class="logintips">没有邮箱？<a href="javascript:$('#emr').hide();$('#mbr').fadeIn();">用手机注册</a></td>
		</tr>
		<tr id="mbr" style="display:none;">
			<td align="right">*手机号码：</td>
			<td><input type="text" value="" name="phone" id="phone" class="logintext" tabindex="2"></td>
			<td class="logintips">没有手机？<a href="javascript:$('#mbr').hide();$('#emr').fadeIn();">用邮箱注册</a></td>
		</tr>
		<tr>
			<td align="right">*设置密码：</td>
			<td><input type="password"  name="pwd"  id="pwd" class="logintext" tabindex="3"></td>
			<td class="logintips">&nbsp;</td>
		</tr>
		<tr>
			<td align="right">*昵称：</td>
			<td><input type="text" value="" name="username" id="username" class="logintext" tabindex="4"></td>
			<td class="logintips">&nbsp;</td>
		</tr>
		<tr>
			<td align="right">*姓名：</td>
			<td><input type="text" value="" name="name" id="name" class="logintext" tabindex="5"></td>
			<td class="logintips">&nbsp;</td>
		</tr>
		<tr>
			<td align="right">*身份证：</td>
			<td><input type="text" value="" name="code" id="code" class="logintext" tabindex="6"></td>
			<td class="logintips">&nbsp;</td>
		</tr>
	    <?php if ($ischeckcode){?>
		<tr><td align="right">*验证码：</td>
			<td colspan="2"><input type="text" class="logintext_code" name="checkcode" id="checkcode" tabindex="7">
			<img src="<?php echo HIGHPHP_WWW_HOST.'captcha?t='.time()?>" onclick="
				    this.src='<?php echo HIGHPHP_WWW_HOST.'captcha'?>?t='+Math.random();" style="cursor: pointer;" title="点击更换"/>
			</td>
		</tr>
	    <?php }else {
	        echo '<tr style="display:none"><td colspan="3"><input type="text" class="logintext" name="checkcode" id="checkcode"></td></tr>';
	    }?>
		<tr><td align="right">&nbsp;</td>
			<td><input type="submit" value="注 册" class="regbtn" tabindex="8"></td><td class="logintips">&nbsp;</td>
		</tr>
	</table>
</form>
</div>
<?php framework::view('index/footer')?>